// swift-tools-version: 5.6
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription


let package = Package(
    name: "WeCloudTRTC",
    platforms: [
        .iOS(.v14),
        .macOS(.v10_15)
    ],
    products: [
        .library(
            name: "WeCloudTRTC",
            targets: ["WeCloudTRTC"]),
    ],
    dependencies: [

        .package(name: "SwiftProtobuf", url: "https://github.com/apple/swift-protobuf.git", .upToNextMajor(from: "1.18.0")),
        
        .package(name: "Promises", url: "https://github.com/google/promises.git", .upToNextMajor(from: "2.0.0")),
        
        .package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.4.2")),
        
        .package(url: "https://github.com/apple/swift-collections.git", .upToNextMajor(from: "1.0.1")),
        
        .package(url: "https://github.com/SFSafeSymbols/SFSafeSymbols", .upToNextMajor(from: "2.1.3")),

    ],
    targets: [
        .target(
            name: "WeCloudTRTC",
            dependencies: [
                "WebRTC","SwiftProtobuf","Promises","SFSafeSymbols",
                .product(name: "Logging", package: "swift-log"),
                .product(name: "Collections", package: "swift-collections")
            ],
            path: "Sources",
            swiftSettings: [
                .define("LK_USING_CUSTOM_WEBRTC_BUILD"),
                .define("LK_COMPUTE_VIDEO_SENDER_PARAMETERS")
            ]
        ),
        
        .binaryTarget(
            name: "WebRTC",
            path: "sdk/WebRTC.xcframework"
        ),
        
        .testTarget(
            name: "WeCloudTRTCTests",
            dependencies: ["WeCloudTRTC"]),
    ]
)
